//
//  WriteToBeReviewedTaskViewController.m
//  MyProject
//
//  Created by Pei on 16/7/30.
//  Copyright © 2016年 Xiaobo Pei. All rights reserved.
//

/*
 获取到的数据为：{
 AuditLogList =     (
 );
 Error = "";
 ErrorCode = "";
 RepairAttachUrlList =     (
 "http://202.127.25.114:8081/api/sqcp/resource/GetResourceContent?id=254"
 );
 RepairDate = "2016-07-25T14:46:40.38";
 RepairDesc = "u\U65e0\U754f\U65e0\U60e7\U5fd8\U8bb0\U5fd8\U8bb0";
 RepairUserName = "\U6d66\U4e1c\U6d4b\U8bd5\U4e8c";
 RiskAttachUrlList =     (
 "http://202.127.25.114:8081/api/sqcp/resource/GetResourceContent?id=228",
 "http://202.127.25.114:8081/api/sqcp/resource/GetResourceContent?id=231"
 );
 RiskDesc = "\U6709\U8fdd\U89c4";
 Success = 1;
 }
 */

#import "WriteToBeReviewedTaskViewController.h"
#import "HTHorizontalSelectionList.h"
#import "WriteToBeChangeTaskCell.h"
#import "YMCaptureViewController.h"
#import "UIImageView+WebCache.h"
#import "SHHistoryCell.h"
#import "UserInfo.h"
#import "ToBeReviewedTaskListViewController.h"
#import "JZAlbumViewController.h"

@interface WriteToBeReviewedTaskViewController ()<HTHorizontalSelectionListDataSource, HTHorizontalSelectionListDelegate, UITableViewDataSource, UITableViewDelegate,UIGestureRecognizerDelegate>
{
    HTHorizontalSelectionList *_segementView;
    
    NSArray *_titleArray;
    
    UIScrollView *_firstScrollView;
    
    UITableView *_myTable;
    
    //UIButton *addBtn;
    
    UITextView *inputField;
    NSDictionary *_currentDic;
    
    NSString *_currentStr;
    
    NSDictionary *_dataDic;
    
    NSMutableArray *_imageArray;
    NSMutableArray *_imageDataArray;
    //UIView *lineView;
    int currentID;
    
    NSArray *_secondArray;
    
    NSArray *imageUrlList0;
    NSArray *imageUrlList1;
}

@end

@implementation WriteToBeReviewedTaskViewController

- (id)initWithData:(NSDictionary*)dic  InspectionID:(int)id
{
    self = [super init];
    if (self) {
        _currentDic = dic;
        currentID = id;
        
        NSArray *tempArray = [[NSUserDefaults standardUserDefaults] objectForKey:Dic_AuditState];
        if (tempArray != nil && tempArray.count > 0) {
            
        }else{
            //AuditState
            [[YMNetLib getInstance] connectWithAction:Dictionary_Type_API method:@"GET" withContent:@"DicType=AuditState" withBody:nil withDelegate:self];
            _currentStr = @"Dic_AuditState";

        }
        
    }
    return self;
}

- (void)getData:(NSDictionary*)data ID:(int)id{
    //Get_GetRiskRepairRecordDetail
    [[YMNetLib getInstance] connectWithAction:Get_GetRiskRepairRecordDetail method:@"GET" withContent:[NSString stringWithFormat:@"InspectionID=%d&RepairID=%d", id, [[data valueForKey:@"InspectTaskID"] intValue]] withBody:nil withDelegate:self];
    _currentStr = Get_GetRiskRepairRecordDetail;
}

- (void)NetDoOverSuccess:(NSDictionary*)body
{
    if ([_currentStr isEqualToString:Get_GetRiskRepairRecordDetail]) {
        if ([[YMNetDataUtil getSuccessState:body] intValue] == 1)
        {
            _dataDic = body;
            _secondArray = [_dataDic objectForKey:@"AuditLogList"];
            
            [self initScrollView];
        }
    }else if ([_currentStr isEqualToString:Get_AuditRepairRecord]){
        if ([[YMNetDataUtil getSuccessState:body] intValue] == 1){
            for (UIViewController *temp in self.navigationController.viewControllers) {
                if ([temp isKindOfClass:[ToBeReviewedTaskListViewController class]]) {
                    [self.navigationController popToViewController:temp animated:YES];
                }
            }
        }
        [[NSNotificationCenter defaultCenter] postNotificationName:@"Reload_ToBeReviewed_LIst" object:nil];
    }
    else{
        [[NSUserDefaults standardUserDefaults] setObject:[body valueForKey:@"DicList"] forKey:Dic_AuditState];
    }
}


- (void)viewDidLoad {
    [super viewDidLoad];
    
    _imageArray = [[NSMutableArray alloc] initWithCapacity:3];
    _imageDataArray = [[NSMutableArray alloc] initWithCapacity:3];
    


    
    UIButton *rightBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 40, 22)];
    [rightBtn setTitle:@"保存" forState:UIControlStateNormal];
    [rightBtn setTitleColor:kBlueColor forState:UIControlStateNormal];
    rightBtn.titleLabel.font = kAppFont(Home_Big_Size);
    [rightBtn addTarget:self action:@selector(rightBtnAcion) forControlEvents:UIControlEventTouchUpInside];
    //[self.navigationItem setRightBarButtonItem:[[UIBarButtonItem alloc] initWithCustomView:rightBtn]];
    
    _titleArray = @[@"问题整改", @"审批历史"];
    

    [self initSelectView];
    
    
    [self initBottomBtn];
    
    [self getData:_currentDic ID:currentID];
}


- (void)navigationBack
{
    NSMutableDictionary *YYYY = [[NSMutableDictionary alloc] initWithDictionary:_currentDic];
    if (inputField.text != nil && inputField.text.length > 0) {
        if ([self.delegate respondsToSelector:@selector(passValue:)]) {
            [YYYY setValue:inputField.text forKey:@"AuditDesc"];
            [self.delegate passValue:YYYY];
        }
    }
    
    [self.navigationController popViewControllerAnimated:YES];
}



- (void)initBottomBtn{
    UIButton *passBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    passBtn.frame = CGRectMake(0.0f, _segementView.bottom+(kDeviceHeight-50.0f-NAV_HEIGHT-_segementView.height), kDeviceWidth/2.0f, 50.0f);
    [passBtn setTitle:@"通过" forState:UIControlStateNormal];
    [passBtn setTitleColor:kWhiteColor forState:UIControlStateNormal];
    //[passBtn setBackgroundColor:kRGB(55, 142, 248)];
    [passBtn setBackgroundImage:[JackTool imageWithColor:kRGB(55, 142, 248)] forState:UIControlStateNormal];
    [passBtn addTarget:self action:@selector(passBtnAction) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:passBtn];
    
    UIButton *refuseBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    refuseBtn.frame = CGRectMake(kDeviceWidth/2.0f, kDeviceHeight-50.0f-NAV_HEIGHT, kDeviceWidth/2.0f, 50.0f);
    [refuseBtn setTitle:@"拒绝" forState:UIControlStateNormal];
    [refuseBtn setTitleColor:kWhiteColor forState:UIControlStateNormal];
    //[refuseBtn setBackgroundColor:kRGB(232, 56, 51)];
    [refuseBtn setBackgroundImage:[JackTool imageWithColor:kRGB(232, 56, 51)] forState:UIControlStateNormal];
    [refuseBtn addTarget:self action:@selector(refuseBtnAction) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:refuseBtn];
}

- (void)passBtnAction{
    //Get_AuditRepairRecord
    NSDictionary *bodyD = [NSDictionary dictionaryWithObjectsAndKeys:
                           [[UserInfo getInstance] getUserID],@"UserID",
                           [NSNumber numberWithInt:currentID],@"InspectionID",
                           [NSNumber numberWithInt:[[_currentDic valueForKey:@"InspectTaskID"] intValue]],@"InspectTaskID",
                           @"",@"DeadLine",
                           inputField.text,@"AuditDesc",
                           [NSNumber numberWithInt:0],@"AuditResult",//0通过 1 拒绝
                           nil];
    [[YMNetLib getInstance] connectWithAction:Get_AuditRepairRecord method:@"POST" withContent:@"" withBody:bodyD withDelegate:self];
    _currentStr = Get_AuditRepairRecord;
}

- (void)refuseBtnAction{
    //Get_AuditRepairRecord
    NSDictionary *bodyD = [NSDictionary dictionaryWithObjectsAndKeys:
                           [[UserInfo getInstance] getUserID],@"UserID",
                           [NSNumber numberWithInt:currentID],@"InspectionID",
                           [NSNumber numberWithInt:[[_currentDic valueForKey:@"InspectTaskID"] intValue]],@"InspectTaskID",
                           @"",@"DeadLine",
                           inputField.text,@"AuditDesc",
                           [NSNumber numberWithInt:1],@"AuditResult",//0通过 1 拒绝
                           nil];
    [[YMNetLib getInstance] connectWithAction:Get_AuditRepairRecord method:@"POST" withContent:@"" withBody:bodyD withDelegate:self];
    _currentStr = Get_AuditRepairRecord;
}

- (void)rightBtnAcion
{
    NSMutableDictionary *dic = [[NSMutableDictionary alloc] initWithCapacity:3];
    [dic setValue:inputField.text forKey:@"Write_WenTi"];
    [dic setObject:_imageArray forKey:@"Image_List"];
    [dic setValue:[NSNumber numberWithInt:[[_currentDic valueForKey:@"InspectTaskID"] intValue]] forKey:@"InspectTaskID"];
    
    if ([self.delegate respondsToSelector:@selector(passValue:)]) {
        [self.delegate passValue:dic];
    }
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)initScrollView
{
    _firstScrollView = [[UIScrollView alloc] init];
    _firstScrollView.frame = CGRectMake(0.0f, _segementView.bottom, kDeviceWidth, kDeviceHeight-NAV_HEIGHT -_segementView.height-50.0f);
    _firstScrollView.backgroundColor = kWhiteColor;
    _firstScrollView.contentSize = CGSizeMake(kDeviceWidth, (kDeviceHeight-NAV_HEIGHT-_segementView.height-50.0f)+10.0f);
    [self.view addSubview:_firstScrollView];
    
    UILabel *titleLbl0 = [[UILabel alloc] init];
    titleLbl0.frame = CGRectMake(10.0f, 10.0f, 80, Home_Big_Size);
    titleLbl0.font = kAppFont(Home_Big_Size);
    titleLbl0.text = @"隐患描述:";
    [_firstScrollView addSubview:titleLbl0];
    
    UIView *lineView10 = [[UIView alloc] init];
    lineView10.frame = CGRectMake(0.0f, titleLbl0.bottom+10.0f, kDeviceWidth, 0.5f);
    lineView10.backgroundColor = kGreenColor;
    [_firstScrollView addSubview:lineView10];
    
    UILabel *contenLbl0 = [[UILabel alloc] init];
    contenLbl0.frame = CGRectMake(10.0f, lineView10.origin.y+6.0f, kDeviceWidth-20.0f, 0.0f);
    contenLbl0.textColor = kGreenColor;
    contenLbl0.font = kAppFont(Home_Big_Size-2.0f);
    contenLbl0.numberOfLines = 0;
    contenLbl0.lineBreakMode = NSLineBreakByWordWrapping;//UILineBreakModeWordWrap;
    contenLbl0.text = [_dataDic valueForKey:@"RiskDesc"];
    NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:contenLbl0.font,NSFontAttributeName, nil];
    CGSize textSize= [contenLbl0.text boundingRectWithSize:CGSizeMake(kDeviceWidth-20.0f-titleLbl0.width,MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin  attributes:dic context:Nil].size;
    contenLbl0.frame = CGRectMake(10.0f, lineView10.origin.y+6.0f, textSize.width, textSize.height);
    [_firstScrollView addSubview:contenLbl0];
    
    UIView *lineView1 = [[UIView alloc] init];
    lineView1.frame = CGRectMake(0.0f, contenLbl0.bottom+40.0f, kDeviceWidth, 0.5f);
    lineView1.backgroundColor = kGreenColor;
    [_firstScrollView addSubview:lineView1];
    
    NSArray *imageA0 = [_dataDic objectForKey:@"RiskAttachUrlList"];
    
    imageUrlList0 = imageA0;
    
    int totalloc = 4;
    CGFloat tempWidth = (kDeviceWidth-10.0f*5.0f)/4.0f;
    CGFloat tempHeight = (kDeviceWidth-10.0f*5.0f)/4.0f;
    
    int margin = 10;
    float yyy = 0.0f;
    for (int i = 0; i < imageA0.count; i ++) {
        
        int row=i/totalloc;//行号
        //1/3=0,2/3=0,3/3=1;
        int loc=i%totalloc;//列号
        
        CGFloat appviewx = margin+(margin+tempWidth)*loc;
        CGFloat appviewy = margin+(margin+tempHeight)*row;
        
        
        UIImageView *tempImageView = [[UIImageView alloc] init];
        NSString *imageUrl = [imageA0 objectAtIndex:i];
        
        tempImageView.userInteractionEnabled=YES;
        tempImageView.tag = i;
        UITapGestureRecognizer *singleTap =[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(onClickImage:)];
        [tempImageView addGestureRecognizer:singleTap];
        
        
        tempImageView.frame = CGRectMake(appviewx, lineView1.bottom+appviewy, tempWidth, tempHeight);
        [tempImageView sd_setImageWithURL:[NSURL URLWithString:imageUrl] placeholderImage:[UIImage imageNamed:@"normalDefault"]];
        tempImageView.contentMode = UIViewContentModeScaleToFill;
        //[tempImageView setClipsToBounds:YES];
        
        tempImageView.backgroundColor = [UIColor grayColor];
        [_firstScrollView addSubview:tempImageView];
        
        yyy = tempImageView.bottom;
    }
    
    if (imageA0 == nil || imageA0.count <= 0) {
        yyy = lineView1.origin.y+40.0;
    }
    
    UIView *lineView01 = [[UIView alloc] init];
    lineView01.frame = CGRectMake(0.0f, yyy+10.0f, kDeviceWidth, 0.5f);
    lineView01.backgroundColor = kBlackColor;
    [_firstScrollView addSubview:lineView01];

    
    
    UILabel *titleLbl1 = [[UILabel alloc] init];
    titleLbl1.frame = CGRectMake(10.0f, lineView01.bottom+ 10.0f, 80, Home_Big_Size);
    titleLbl1.font = kAppFont(Home_Big_Size);
    titleLbl1.text = @"整改描述:";
    [_firstScrollView addSubview:titleLbl1];
    
    UIView *lineView20 = [[UIView alloc] init];
    lineView20.frame = CGRectMake(0.0f, titleLbl1.bottom+10.0f, kDeviceWidth, 0.5f);
    lineView20.backgroundColor = kGreenColor;
    [_firstScrollView addSubview:lineView20];

    
    UILabel *contenLbl1 = [[UILabel alloc] init];
    contenLbl1.frame = CGRectMake(10, lineView20.origin.y+6.0f, kDeviceWidth-20.0f, 0.0f);
    contenLbl1.textColor = kGreenColor;
    contenLbl1.font = kAppFont(Home_Big_Size-2);
    contenLbl1.numberOfLines = 0;
    contenLbl1.lineBreakMode = NSLineBreakByWordWrapping;//UILineBreakModeWordWrap;
    contenLbl1.text = [_dataDic valueForKey:@"RepairDesc"];
    NSDictionary *dic1 = [NSDictionary dictionaryWithObjectsAndKeys:contenLbl1.font,NSFontAttributeName, nil];
    CGSize textSize1= [contenLbl1.text boundingRectWithSize:CGSizeMake(kDeviceWidth-20.0f-titleLbl1.width,MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin  attributes:dic1 context:Nil].size;
    contenLbl1.frame = CGRectMake(10.0f, lineView20.origin.y+6.0f, textSize1.width, textSize1.height);
    [_firstScrollView addSubview:contenLbl1];
    
    UIView *lineView2 = [[UIView alloc] init];
    lineView2.frame = CGRectMake(0.0f, contenLbl1.bottom+40.0f, kDeviceWidth, 0.5f);
    lineView2.backgroundColor = kGreenColor;
    [_firstScrollView addSubview:lineView2];
    
    
    NSArray *imageA1 = [_dataDic objectForKey:@"RepairAttachUrlList"];
    imageUrlList1 = imageA1;
    
    float yyy2 = 0.0f;
    for (int i = 0; i < imageA1.count; i ++) {
        
        int row=i/totalloc;//行号
        //1/3=0,2/3=0,3/3=1;
        int loc=i%totalloc;//列号
        
        CGFloat appviewx = margin+(margin+tempWidth)*loc;
        CGFloat appviewy = margin+(margin+tempHeight)*row;
        
       
        
        UIImageView *tempImageView = [[UIImageView alloc] init];
        NSString *imageUrl = [imageA1 objectAtIndex:i];
        
        tempImageView.userInteractionEnabled=YES;
        tempImageView.tag = i;
        UITapGestureRecognizer *singleTap =[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(onClickImage1:)];
        [tempImageView addGestureRecognizer:singleTap];
        
        tempImageView.frame = CGRectMake(appviewx, lineView2.bottom+appviewy, tempWidth, tempHeight);
        [tempImageView sd_setImageWithURL:[NSURL URLWithString:imageUrl] placeholderImage:[UIImage imageNamed:@"normalDefault"]];
        tempImageView.contentMode = UIViewContentModeScaleToFill;
        //[tempImageView setClipsToBounds:YES];
        
        tempImageView.backgroundColor = [UIColor grayColor];
        [_firstScrollView addSubview:tempImageView];
        
        yyy2 = tempImageView.bottom;
    }
    
    if (imageA1 == nil || imageA1.count <= 0) {
        yyy2 = lineView2.origin.y+40.0f;
    }
    
    UIView *lineView11 = [[UIView alloc] init];
    lineView11.frame = CGRectMake(0.0f, yyy2+10.0f, kDeviceWidth, 0.5f);
    lineView11.backgroundColor = kBlackColor;
    [_firstScrollView addSubview:lineView11];

    
    UILabel *titleLbl2 = [[UILabel alloc] init];
    titleLbl2.frame = CGRectMake(10.0f, lineView11.bottom+ 10.0f, 80, Home_Big_Size);
    titleLbl2.font = kAppFont(Home_Big_Size);
    titleLbl2.text = @"审批意见:";
    [_firstScrollView addSubview:titleLbl2];
    
    UIView *lineView6 = [[UIView alloc] init];
    lineView6.frame = CGRectMake(0.0f, titleLbl2.bottom+10.0f, kDeviceWidth, 0.5f);
    lineView6.backgroundColor = kGreenColor;
    [_firstScrollView addSubview:lineView6];

    inputField = [[UITextView alloc] init];
    inputField.frame = CGRectMake(10, lineView6.origin.y+6.0f, kDeviceWidth-20.0f, 100.0f);
    inputField.font = kAppFont(Home_Small_Size+2.0f);
    inputField.textColor = kGreenColor;
    [_firstScrollView addSubview:inputField];

    _firstScrollView.contentSize = CGSizeMake(kDeviceWidth, inputField.bottom+10.0f);
}

- (void)onClickImage:(UITapGestureRecognizer*)sender{
    JZAlbumViewController *jzAlbumVC = [[JZAlbumViewController alloc] init];
    
    jzAlbumVC.currentIndex = sender.view.tag;//这个参数表示当前图片的index，默认是0
    
    jzAlbumVC.imgArr = [[NSMutableArray alloc] initWithArray:imageUrlList0];//图片数组，可以是url，也可以是UIImage
    [self.navigationController pushViewController:jzAlbumVC animated:YES];
}

- (void)onClickImage1:(UITapGestureRecognizer*)sender{
    JZAlbumViewController *jzAlbumVC = [[JZAlbumViewController alloc] init];
    
    jzAlbumVC.currentIndex =sender.view.tag;//这个参数表示当前图片的index，默认是0
    
    jzAlbumVC.imgArr = [[NSMutableArray alloc] initWithArray:imageUrlList1];//图片数组，可以是url，也可以是UIImage
    [self.navigationController pushViewController:jzAlbumVC animated:YES];
}


- (void)initTable
{
    _myTable = [[UITableView alloc] init];
    _myTable.frame = CGRectMake(0.0f, 40.0f, kDeviceWidth, kDeviceHeight-NAV_HEIGHT-_segementView.height-50.0f);
    _myTable.delegate = self;
    _myTable.dataSource = self;
    _myTable.backgroundColor = kRGB(241, 246, 250);
    _myTable.separatorStyle = UITableViewCellSeparatorStyleNone;
    [self.view addSubview:_myTable];
}


- (void)initSelectView{
    _segementView = [[HTHorizontalSelectionList alloc] initWithFrame:CGRectMake(0.0f, 0.0f, kDeviceWidth, 40.0f)];
    _segementView.delegate = self;
    _segementView.dataSource = self;
    _segementView.autoFillWidth = YES;
    _segementView.font = 14;
    _segementView.sideMargin = 0;
    _segementView.isAdjustBottomLine = YES;
    _segementView.bottomLineMargin = 10.f;
    _segementView.selectionIndicatorColor = kBlueColor;
    [_segementView setSelectedButtonIndex:0];
    [_segementView setTitleColor:kGreenColor forState:UIControlStateNormal];
    [_segementView setBottomTrimColor:kGreenColor];
    [self.view addSubview:_segementView];
    
}


#pragma mark - HTHorizontalSelectionList delegate
- (NSInteger)numberOfItemsInSelectionList:(HTHorizontalSelectionList *)selectionList
{
    return _titleArray.count;
}

- (NSString *)selectionList:(HTHorizontalSelectionList *)selectionList titleForItemWithIndex:(NSInteger)index
{
    return _titleArray[index];
}

- (void)selectionList:(HTHorizontalSelectionList *)selectionList didSelectButtonWithIndex:(NSInteger)index
{
    switch (index) {
        case 0:
        {
            [_myTable removeFromSuperview];
            [self.view addSubview:_firstScrollView];
        }
            break;
        case 1:
        {
            
            
            if (_secondArray != nil && _secondArray.count > 0) {
                if (_myTable == nil) {
                    [self initTable];
                }
                [_myTable reloadData];
            }else{
                if (_myTable == nil) {
                    [self initTable];
                }

                [_myTable reloadData];
                //[self getSecondData];
            }
            
            [_firstScrollView removeFromSuperview];
            [self.view addSubview:_myTable];
            
        }
            break;
            
        default:
            break;
    }
}

- (void)getSecondData
{
    //Get_ToBeChange_Task_CheckItem_Detail
    [[YMNetLib getInstance] connectWithAction:Get_ToBeChange_Task_CheckItem_Detail method:@"GET" withContent:[NSString stringWithFormat:@"InspectionID=%d&RepairID=%d",currentID,[[_currentDic valueForKey:@"InspectTaskID"] intValue]] withBody:nil withDelegate:self];
    _currentStr = Get_ToBeChange_Task_CheckItem_Detail;
}

//- (void)NetDoOverSuccess:(NSDictionary*)body
//{
//    if ([_currentStr isEqualToString:Get_ToBeChange_Task_CheckItem_Detail]) {
//        if ([[YMNetDataUtil getSuccessState:body] intValue] == 1)
//        {
//            _dataDic = body;
//            [_myTable reloadData];
//        }
//    }else{
//        if ([[YMNetDataUtil getSuccessState:body] intValue] == 1)
//        {
//            
//        }
//    }
//}



#pragma mark  ************************* UITableViewDataSource **************************************
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    id tempID = [_dataDic valueForKey:@"AuditLogList"];
    if ([tempID isKindOfClass:[NSString class]]) {
        if ([tempID isEqualToString:@""]) {
            return 0;
        }
    }
    if (_secondArray == nil || _secondArray.count <= 0) {
        return 0;
    }
    return _secondArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    static NSString *identifier = @"WriteToBeChangeTaskCell";
    WriteToBeChangeTaskCell *cell = (WriteToBeChangeTaskCell *)[tableView dequeueReusableCellWithIdentifier:identifier];
    if (cell == nil)
    {
        cell = [[WriteToBeChangeTaskCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:identifier];
    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    NSArray *tempA = [_dataDic valueForKey:@"AuditLogList"];
    NSDictionary *dic = [tempA objectAtIndex:indexPath.row];
    [cell showWithData:dic];
    return cell;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 74.0f;
}


#pragma mark UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
}


@end
